<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>POST请求添加</title>
</head>
<body>
    <input type="button" value="添加书本">
    <!-- 引入 axios.JS 库 -->
    <script src="./axios.js"></script>
    <script>
        document.querySelector('input').addEventListener('click',function () {
            axios({
            method: 'POST',
            url:'http://www.itcbc.com:3006/api/addbook',
            data: {
                publisher: '头发去无踪',
                author: 'YOYO',
                bookname: '门门都精通',
                appkey: 'YOYO666'

            }
        }).then(({data}) => {
            console.log(data)
        })
        })
    </script>
</body>
</html>